﻿using Microsoft.AspNetCore.Mvc;
using System.Diagnostics;
using Water_and_electricity_metering_management_system.Models;
using Water_and_electricity_metering_management_system.Models.Entitys;

namespace Water_and_electricity_metering_management_system.Controllers
{
    public class HomeController : Controller
    {
        WemmsDbContext dbContext = new WemmsDbContext();

        public IActionResult Index()
        {
            Buiding b = dbContext.Buidings.Select(b => b).Where(
                b => b.BuidingName == HttpContext.Session.GetString("BuidingName").Trim()
                && b.HomeNumbe == HttpContext.Session.GetInt32("HomeNumbe")).FirstOrDefault();

            ViewBag.Buiding = b;

            return View();
        }

    }
}